package main

import (
	"fmt"
	"log"
	"myproject/internal/cdn"
	"myproject/internal/container"
	"myproject/internal/ecs"
	"myproject/pkg/aliyun"
	"os"
)

func main() {
	// 创建基础客户端
	baseClient := aliyun.NewBaseClient(
		os.Getenv("STG_ALIBABA_CLOUD_ACCESS_KEY_ID"),
		os.Getenv("STG_ALIBABA_CLOUD_ACCESS_KEY_SECRET"),
		"cn-shenzhen",
	)

	// 创建服务容器
	container := container.NewContainer(baseClient)

	// 创建服务
	cdnService := cdn.NewService(container)
	ecsService := ecs.NewService(container)

	// 使用服务
	if err := cdnService.DoSomething(); err != nil {
		log.Printf("CDN service error: %v", err)
	}

	data, err := ecsService.DoSomething()
	if err != nil {
		log.Printf("ECS service error: %v", err)
	}
	fmt.Println(data)
}
